package com.py.credit.clean.code;

import org.apache.commons.lang3.StringUtils;

public class DoubleCheck {

    /**
     * 校验输入值为double类型(非必填)
     *
     * @param data
     * @param extend
     * @return
     */
    public boolean run(String data, String extend) {
        if (StringUtils.isNotBlank(data)) {
            try {
                Double dCheckValue = Double.parseDouble(data);
                if (dCheckValue instanceof Double == false) {
                    return false;
                }
            } catch (NumberFormatException e) {
                return false;
            }
        }

        return true;
    }
}
